<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import ="com.xuya.entity.* " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'main.jsp' starting page</title>
  </head>
  <% List<Product> list = (List<Product>)request.getAttribute("prodlist");%>
  <body>
  <a href = "add.jsp">添加新商品</a>
   <table border="1" width=70%>//关于table的属性
   	<tr>
   		<th>商品名称</th>
   		<th>商品价格</th>
   		<th>操作</th>
   	</tr>
   	<%for(Product p :list){ %>
   	<tr>
   		<td><%=p.getName() %></td>
   		<td><%=p.getPrice() %></td>
   		<td>
   			<a href = "del.jspx?id=<%= p.getId()%>">删除</a>
   			<a href = "update.jspx?id=<%= p.getId()%>">修改</a>
   		</td>
   	</tr>
   	<%}%>
   </table>
  </body>
</html>
